﻿<UserControl x:Class="SilverlightTestApplication.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:SE="clr-namespace:SilverlightShaderEffects;assembly=SilverlightShaderEffects" 
    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">
   <UserControl.Resources>
      <Storyboard x:Name="RippleStoryBoard" RepeatBehavior="Forever">
         <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="RippleImage" Storyboard.TargetProperty="(UIElement.Effect).(SE:RippleShaderEffect.Phase)">
            <SplineDoubleKeyFrame KeyTime="00:00:02" Value="3.14159265358979" KeySpline="0.79,0.21,0.4,0.75"/>
            <SplineDoubleKeyFrame KeyTime="00:00:04" Value="6.28318530717959" KeySpline="0.79,0.21,0.4,0.75"/>
         </DoubleAnimationUsingKeyFrames>
      </Storyboard>
      <Storyboard x:Name="TransitionStoryBoard" RepeatBehavior="Forever">
         <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="TransitionImage" Storyboard.TargetProperty="(UIElement.Effect).(SE:WaterTransitionShaderEffect.Progress)">
            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.0"/>
            <SplineDoubleKeyFrame KeyTime="00:00:02" Value="1.0"/>
            <SplineDoubleKeyFrame KeyTime="00:00:03" Value="1.0"/>
            <SplineDoubleKeyFrame KeyTime="00:00:05" Value="0.0"/>
            <SplineDoubleKeyFrame KeyTime="00:00:06" Value="0.0"/>
         </DoubleAnimationUsingKeyFrames>
      </Storyboard>
   </UserControl.Resources>
   <Grid>
      <Grid.ColumnDefinitions>
         <ColumnDefinition Width="0.5*"/>
         <ColumnDefinition Width="0.5*"/>
      </Grid.ColumnDefinitions>
      <Grid.RowDefinitions>
         <RowDefinition Height="0.5*"/>
         <RowDefinition Height="0.5*"/>
      </Grid.RowDefinitions>
      <Grid Grid.Column="0" Grid.Row="0">
         <Image Source="Images/Tulips.jpg" Stretch="UniformToFill"/>
         <TextBlock FontSize="24" HorizontalAlignment="Center" VerticalAlignment="Center">Normal</TextBlock>
      </Grid>
      <Grid Grid.Column="0" Grid.Row="1">
         <Image Source="Images/Tulips.jpg" Stretch="UniformToFill">
            <Image.Effect>
               <SE:InvertColorShaderEffect />

            </Image.Effect>
         </Image>
         <TextBlock FontSize="24" HorizontalAlignment="Center" VerticalAlignment="Center">Invert</TextBlock>
      </Grid>
      <Grid Grid.Column="1" Grid.Row="0">
         <Image Name="RippleImage" Source="Images/Tulips.jpg" Stretch="UniformToFill">
            <Image.Effect>
               <SE:RippleShaderEffect 
                  Center="0.3,0.3" 
                  Amplitude="1" 
                  Frequency="5" 
                  Phase="0"  />

            </Image.Effect>
         </Image>
         <TextBlock FontSize="24" HorizontalAlignment="Center" VerticalAlignment="Center">Ripple</TextBlock>
      </Grid>
      <Grid Grid.Column="1" Grid.Row="1">
         <Image Name="TransitionImage" Source="Images/Tulips.jpg" Stretch="UniformToFill">
            <Image.Effect>
               <SE:WaterTransitionShaderEffect>
                  <SE:WaterTransitionShaderEffect.SecondInput>
                     <ImageBrush ImageSource="Images/Chrysanthemum.jpg"/>
                  </SE:WaterTransitionShaderEffect.SecondInput>
               </SE:WaterTransitionShaderEffect>
            </Image.Effect>
         </Image>
         <TextBlock FontSize="24" HorizontalAlignment="Center" VerticalAlignment="Center">Transition</TextBlock>
      </Grid>

   </Grid>
</UserControl>
